package com.lswms.modules.lswms.dao.uniquecode;

import com.lswms.common.dao.BaseDao;
import com.lswms.modules.lswms.entity.uniquecode.UniquecodeEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 唯一码
 *
 * @author DX sunlightcs@gmail.com
 * @since 1.0.0 2021-07-15
 */
@Mapper
public interface UniquecodeDao extends BaseDao<UniquecodeEntity> {

    @Select("select count(*) from lswms_uniqueCode where uniqueCode=#{uniquecode}")
    Integer checkUniquecode(@Param("uniquecode")String unique);

    @Select("select * from lswms_uniqueCode where sku=#{sku}")
    List<UniquecodeEntity> getListBySku(@Param("sku")String sku);

    @Select("select * from lswms_uniqueCode where uniqueCode=#{uniqueCode}")
    UniquecodeEntity getListByUniquecode(@Param("uniqueCode")String uniqueCode);



}
